package com.xzt.meeting.utils;

import com.mysql.jdbc.StringUtils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author xzt
 * @Date 2022/5/8 22:01
 * @Version 1.0
 * @Introduce
 */
public class MeetingUtils {

    public static Cookie getCookie(HttpServletRequest request, String cookieName) {
        if (request.getCookies() != null && !StringUtils.isNullOrEmpty(cookieName)) {

            for (Cookie cookie : request.getCookies()) {

                if (cookie.getName().equals(cookieName)) {
                    return cookie;
                }

            }
        }
        return null;
    }
}
